package com.telaxo.shooter2012.factory {
	import com.telaxo.shooter2012.bonus.BonusContainer;
	import com.telaxo.shooter2012.foes.BallShip;
	import com.telaxo.shooter2012.foes.Boss;
	import com.telaxo.shooter2012.foes.Stinger;
	import com.telaxo.shooter2012.gfx.Ship;

	import flash.display.MovieClip;
	import flash.display.Stage;

	/**
	 * @author Benjamin
	 */
	public class EnemyFactory extends AbstractFactory {
		/**
		 * @param text : 
		 * @param stageRef : 
		 */
		public static function createEntity(text : String, stageRef : Stage, target : Ship) : MovieClip {
			switch(text) {
				case "STINGER":
					var stinger : Stinger = new Stinger(stageRef, target);
					stageRef.addChild(stinger);
					return stinger;
					//stinger = null;
					break;
				case "BALLSHIP":
					var ballship : BallShip = new BallShip(stageRef, target);
					stageRef.addChild(ballship);
					return ballship;
					break;
				case "CONTAINER":
					var bonuscontainer : BonusContainer = new BonusContainer(stageRef, null);
					stageRef.addChild(bonuscontainer);
					return bonuscontainer;
					break;
				case "BOSS":
					var boss : Boss = new Boss(stageRef, target);
					stageRef.addChild(boss);
					return boss;
					break;
				default:
					throw new Error("This type of entity don't exist.");
					break;
			}
		}
	}
}
